#function StartPalServer() {
    #cd /root/PalServer
    #./PalServer.sh
    #sudo systemctl restart pal-server
#}


echo "start PalServer..."
#StartPalServer

proc_num=1

while true; do
    # check service alive
    process_num=$(ps aux|grep PalServer-Linux-Test |grep -v grep |wc -l)
    if [ $process_num -ne $proc_num ]; then
        echo "$(date) restart PalServer... " >>/root/Palrestart.log
        sudo systemctl restart pal-server
        #StartPalServer
    fi
    #echo "process num $process_num"
    sleep 30

done
